//
//  XLGHeadImageDownloadQueueInternal.h
//  etionCBLogic
//
//  Created by wjxfhxy on 15-4-30.
//  Copyright (c) 2015年 GuangZhouXuanWu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface XLGHeadImageCache ()
{
    NSString* _filePath;
}

@property(nonatomic,retain) NSString* filePath;

@end

@class XLGHeadImageDownloadQueueSetImageViewImage;

@interface XLGHeadImageDownloadQueueInternal : NSObject<XMSSimpleDownloadManagerDelegate>
{
    XMSSimpleDownloadManager *_sdm;
    
    NSString *_localPath;
    
    NSMutableDictionary *_dicImageCache;
    
    NSLock *_cacheLock;
    
    CGFloat _cornerRadius;
    
    XLGHeadImageDownloadQueueSetImageViewImage *_setImageView;
}

@property(nonatomic,retain) NSString *localPath;
@property(nonatomic,assign) CGFloat cornerRadius;

-(XLGHeadImageCache*)checkDownloadHeadImageWithHeadImageURL:(NSString*)headImageURL;

-(XLGHeadImageCache*)setCacheWithHeadImageURL:(NSString*)headImageURL andHeadImagePath:(NSString*)headImagePath;

-(XLGHeadImageCache*)checkOrStartDownloadHeadImageWhenAddHeadImageURL:(NSString*)headImageURL;

-(BOOL)setOrStartDownloadHeadImageWhenAddHeadImageURL:(NSString*)headImageURL inImageView:(UIImageView*)imageView tag:(NSString*)tag;

-(NSString*)isHeadImageExist:(NSString*)headImageURL;

-(void)terminate;

-(NSString*)isHeadImageExist:(NSString*)headImageURL;

-(void)deleteHeadImage:(NSString*)headImageURL;

-(void)deleteAllHeadImage;

-(void)clearAll;

-(void)clearTag:(NSString*)tag;

@end

@interface XLGHeadImageDownloadQueueSetImageViewImage : NSObject

-(void)cacheImageView:(UIImageView*)imageView withImageURL:(NSString*)imageURL forTag:(NSString*)tag;

-(void)enumerateImageViewCacheForImageURL:(NSString*)imageURL block:(void(^)(UIImageView *imageView,BOOL *deleteCache))block;

-(void)removeImageViewCacheForTag:(NSString*)tag;

@end